<section class="content-header">
    <h1>
        设备开动率
        <!-- <div class="btn-group pull-right">
            <button type="button" class="btn btn-default btn-sm" (click)="exportData()">
                数据导出
            </button>
        </div> -->
    </h1>
</section>
<!-- Main content -->
<section class="content">
    <div class="row">
        <div class="col-md-3 col-md-push-9">
            <div class="box box-default">
                <div class="box-header with-border">
                    <h3 class="box-title">查询区域</h3>
                    <div class="box-tools pull-right">
                        <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                    </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                    <div class="form-group">
                        <label for="DateTimeRange">时间</label>
                        <input type="text" class="form-control pull-right" id="DateTimeRange" placeholder="请选择日期" />
                    </div>
                    <!-- <div class="form-group">
                        <label>区域</label>
                        <dx-select-box style="width:100%;height:35px;margin-bottom:10px;border-radius: 0px" [items]="subAreaItems" displayExpr="subArea"
                            [(selectedItem)]="subAareSelected" (onValueChanged)="onSubAreaSelectedChange($event)" [value]="subAreaItems[0]"
                            [searchEnabled]="true">
                        </dx-select-box>
                    </div> -->
                    <div class="form-group">
                        <label>区域</label>
                        <dx-drop-down-box #ddda style="width:100%;height:35px;margin-bottom:10px;border-radius: 0px" [(value)]="subAreaSelected"
                            displayExpr="subArea" placeholder="请选择区域" [showClearButton]="true" (onValueChanged)="onSubAreaSelectedChange($event)"
                            [dataSource]="subAreaItems">
                            <dxo-drop-down-options [height]="310"></dxo-drop-down-options>
                            <div *dxTemplate="let data of 'content'">
                                <button type="button" (click)="clearSubAreaSelected()" class="btn btn-default btn-sm" title="重置">重置</button>&nbsp;&nbsp;&nbsp;
                                <button type="button" (click)="subAreaSelectedOk()" class="btn btn-info btn-sm" title="确定">确定</button>
                                <dx-data-grid [dataSource]="subAreaItems" [hoverStateEnabled]="true" [paging]="{ enabled: true, pageSize: 1000 }" [filterRow]="{ visible: true }"
                                    [(selectedRowKeys)]="subAreaSelected" [scrolling]="{ mode: 'infinite' }" [height]="265" [showColumnLines]="true"
                                    [showRowLines]="true" [showBorders]="true" [rowAlternationEnabled]="true">
                                    <dxo-selection [selectAllMode]="allPages" [showCheckBoxesMode]="always" mode="multiple"></dxo-selection>
                                    <dxi-column dataField="subArea" caption="区域" >
                                    </dxi-column>
                                </dx-data-grid>
                            </div>
                        </dx-drop-down-box>
                    </div>
                    <!-- <div class="form-group">
                        <label>瓶颈设备</label>
                        <dx-select-box style="width:100%;height:35px;margin-bottom:10px;border-radius: 0px" [items]="equipemntItems" displayExpr="equipment"
                            [(selectedItem)]="equipmentSelected" [value]="equipmentSelected" [searchEnabled]="true">
                        </dx-select-box>
                    </div> -->
                    <!-- <div class="form-group">
                        <label>班次</label>
                        <dx-select-box style="width:100%;height:35px;margin-bottom:10px;border-radius: 0px" [items]="shiftItems" displayExpr="shiftName"
                            [(selectedItem)]="shiftSelected" [value]="shiftItems[0]" [searchEnabled]="true">
                        </dx-select-box>
                    </div> -->
                </div>
                <div class="box-footer">
                    <button type="button" class="btn btn-primary" (click)="getReportData()"> 查 询 </button>
                </div>
            </div>
        </div>
        <div class="col-md-9 col-md-pull-3">
            <div class="box box-default">
                <div class="box-header with-border">
                    <h3 class="box-title">设备开动率数据表</h3>
                    <div class="box-tools pull-right">
                        <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                    </div>
                </div>
                <div class="box-body">
                    <dx-data-grid id="gridContainer" [dataSource]="startupList" [showColumnLines]="true" [showRowLines]="true" [showBorders]="true"
                        [rowAlternationEnabled]="true" (onExporting)="onExporting($event)">
                        <dxo-paging [pageSize]="10"></dxo-paging>
                        <dxo-export [enabled]="true" fileName="设备开动率" [allowExportSelectedData]="false"></dxo-export>
                        <dxo-pager [showPageSizeSelector]="true" [allowedPageSizes]="[10, 20, 100]" [showInfo]="true">
                        </dxo-pager>
                        <dxi-column dataField="startTime" caption="开始时间" [width]="100">
                        </dxi-column>
                        <dxi-column dataField="endTime" caption="结束时间" [width]="120">
                        </dxi-column>
                        <dxi-column dataField="subArea" caption="区域" [width]="150">
                        </dxi-column>
                        <dxi-column dataField="equipment" caption="瓶颈工位" [width]="170">
                        </dxi-column>
                        <dxi-column dataField="slowestCT" caption="BN CT" [width]="170">
                        </dxi-column>
                        <dxi-column dataField="sumHour" caption="生产小时(h)" [width]="170">
                        </dxi-column>
                        <dxi-column dataField="sumVAL" caption="产量" [width]="170">
                        </dxi-column>
                        <dxi-column dataField="upTime" caption="开动率(%)" [width]="150" >
                        </dxi-column>
                       
                    </dx-data-grid>
                </div>
            </div>
        </div>
    </div>
   
</section>